package com.liguang.rcs.admin.exception;

import com.liguang.rcs.admin.util.ResponseCode;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
public class BaseException extends RuntimeException {
    private String message;
    private String code;

    public BaseException(String code, String message) {
        super(message);
        this.message = message;
        this.code = code;
    }

    public BaseException(ResponseCode code, String message) {
        super(message);
        this.message = message;
        this.code = code.getCode();
    }

    public BaseException(ResponseCode code) {
        super(code.getCode());
        this.message = code.getMsg();
        this.code = code.getCode();
    }


}
